package com.example.map.rx1demo.demos;

import android.os.Bundle;
import android.support.annotation.Nullable;

import com.trello.rxlifecycle.components.support.RxAppCompatActivity;

import rx.Observable;
import rx.functions.Action1;
/**
 * Created by qundui on 2017/6/3.
 */
public class RxLifecycle_act extends RxAppCompatActivity {
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Observable<String> just = Observable.just("1", "2");
//      just.compose(this.<String>bindUntilEvent(ActivityEvent.PAUSE));
        just.compose(this.<String>bindToLifecycle());
        just.subscribe(new Action1<String>() {
            @Override
            public void call(String s) {

            }
        });
    }
}
